package com.snatch.work.utils.hg;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import javax.net.ssl.SSLHandshakeException;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.NoHttpResponseException;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;

import sun.org.mozilla.javascript.internal.NativeArray;

import com.snatch.common.constant.SnatchConstant;
import com.snatch.common.utils.DateUtil;
import com.snatch.common.utils.StringUtils;
import com.snatch.common.vo.Proxy;
import com.snatch.work.constant.HgConstant;
import com.snatch.work.utils.HttpUtil;
import com.snatch.work.vo.LoginData;
import com.snatch.work.vo.hg.HgParamVO;

/**
 * 皇冠工具类
 * 
 * @author TangLianfang
 * 
 */
public class HgUtil {
	/**
	 * 获得皇冠的httpClient
	 * 
	 * @param url
	 *            第三方系统的url
	 * @param proxy
	 *            代理对象
	 * @return
	 * @throws Exception
	 */

	private static ScriptEngine engine = null;
	
	public static void initScriptEngine(){
		if(null == engine){
			try {
				ScriptEngineManager manager = new ScriptEngineManager();
				engine = manager.getEngineByName("JavaScript");

				// 运行 hg.js
				Reader scriptReader = new InputStreamReader(HgUtil.class.getResourceAsStream("hg.js"));
				try {
					engine.eval(scriptReader);
				} finally {
					scriptReader.close();
				}
			} catch (Exception e) {
				// TODO: handle exception
			}
			
		}
		
	}
	public static DefaultHttpClient getHttpClient(LoginData loginData) throws Exception {
		Proxy proxy = loginData.getProxy();
		int connectionTimeOut = loginData.getWebConfig().getConnectionTimeOut();//连接超时
		int readTimeOut = loginData.getWebConfig().getReadTimeOut();;//读收超时
		
		SchemeRegistry schemeRegistry = new SchemeRegistry();
		schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory
				.getSocketFactory()));
		schemeRegistry.register(new Scheme("https", 443, SSLSocketFactory
				.getSocketFactory()));
		ThreadSafeClientConnManager cm  = new ThreadSafeClientConnManager(schemeRegistry);
		cm.setMaxTotal(20);
		cm.setDefaultMaxPerRoute(20);
		
		DefaultHttpClient httpClient = new DefaultHttpClient(cm);

		String urlPath = HttpUtil.dealHost(loginData.getWebConfig().getUrl()) + "/app/member/";
		
		HttpGet httpGet = HttpUtil.getHttpGet(urlPath);

		HttpRequestRetryHandler myRetryHandler = new HttpRequestRetryHandler() {
			public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
				if (executionCount >= 3) {
					// 如果超过最大重试次数，那么就不要继续了
					return false;
				}
				if (exception instanceof NoHttpResponseException) {
					// 如果服务器丢掉了连接，那么就重试
					return true;
				}
				if (exception instanceof SSLHandshakeException) {
					// 不要重试SSL握手异常
					return false;
				}
				HttpRequest request = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
				boolean idempotent = !(request instanceof HttpEntityEnclosingRequest);
				if (idempotent) {
					// 如果请求被认为是幂等的，那么就重试
					return true;
				}
				return false;
			}
		};

		httpClient.setHttpRequestRetryHandler(myRetryHandler);

		// 设置读取超时时间
		httpClient.getParams().setIntParameter("http.socket.timeout", readTimeOut);
		// 设置连接超时超时
		httpClient.getParams().setIntParameter(HttpConnectionParams.CONNECTION_TIMEOUT, connectionTimeOut);

		// 添加代理
		if (null != proxy) {
			if (proxy.getUsed() == 1) {// 是否使用代理 “1” 使用,“0” 不使用
				String ip = proxy.getIp();// 代理ip
				int port = proxy.getPort();// 代理端口
				String proxyUserName = proxy.getUsername();// 代理账号用户名
				String proxyPassword = proxy.getPassword();// 代理账号密码

				if (!(HttpUtil.isNull(ip) || port <= 0)) {
					// 访问的目标站点，端口和协议
					httpClient.getCredentialsProvider().setCredentials(new AuthScope(ip, port), new UsernamePasswordCredentials(proxyUserName, proxyPassword));
					// 代理的设置
					HttpHost proxyHost = new HttpHost(ip, port);
					httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxyHost);
				}
			}
		}

		HttpContext localContext = new BasicHttpContext();
		HttpResponse response = HttpUtil.execute(httpClient, httpGet, localContext);
		HttpUtil.getHttpContext(response);

		return httpClient;
	}

	/**
	 * 处理皇冠的开赛时间
	 * 
	 * @param startTime
	 *            开赛时间
	 * @param snatchItem
	 *            抓取项
	 * @return
	 */
	public static String dealStartTime(String startTime, String snatchItem) {
		startTime = startTime.trim();

		if (HttpUtil.isNull(startTime)) {// 当开赛时间为空时
			return startTime;
		}

		String result = "";

		String signStr = "<br><font color=red>Running Ball</font>";// 是否会开出滚球盘的标识
		if (startTime.contains(signStr)) {
			startTime = startTime.substring(0, startTime.indexOf(signStr));
		}
		
		int year = Calendar.getInstance().get(Calendar.YEAR);// 获取当前年份

		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String date1 = sdf.format(new java.util.Date());
		String date2 = sdf.format(getCurrYearLast(year));
		boolean mark = false;
		if (date1.equals(date2)) {
			mark = true;
		}

		int hours = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);// 24小时制
		if (snatchItem.equals(SnatchConstant.SNATCH_TYPE_ZC) && hours >= 12 && mark) {
			year = year + 1;
		}

		startTime = year + "-" + startTime.replace("<br>", " ");

		signStr = "a";
		if (startTime.contains(signStr)) {
			startTime = startTime.substring(0, startTime.indexOf(signStr));

			result = addDate(startTime, 12);
		} else {
			signStr = "p";
			if (startTime.contains(signStr)) {
				startTime = startTime.substring(0, startTime.indexOf(signStr));

				int hour = DateUtil.getDataHours(startTime, "yyyy-MM-dd HH:mm");// 获取开赛时间中的小时

				if (hour == 12) {
					result = addDate(startTime, 12);
				} else {
					result = addDate(startTime, 24);
				}
			}
		}
		return result;
	}
	
	public static String hgSnatchTime(String dataContext){
		String snatchtime = "";
		try {
			String data="",time="";
			if (dataContext.contains(HgConstant.TOP_TODAY_GMT)) {
				data = StringUtils.parseFormValue(dataContext, HgConstant.TOP_TODAY_GMT, HgConstant.PARENT_TIME_QUOTE) ;
			}
			if (dataContext.contains(HgConstant.TOP_NOW_GMT)) {
				time = StringUtils.parseFormValue(dataContext, HgConstant.TOP_NOW_GMT, HgConstant.PARENT_TIME_QUOTE);
			}
			if(null != data && null != time && !"".equals(data) && !"".equals(time)){
				snatchtime = data+" "+time;
			}
				
		} catch (Exception e) {
			// TODO: handle exception
		}
		return snatchtime;
	}

	/**
	 * 获取某年最后一天日期
	 * 
	 * @param year
	 *            年份
	 * @return Date
	 */
	public static Date getCurrYearLast(int year) {
		Calendar calendar = Calendar.getInstance();
		calendar.clear();
		calendar.set(Calendar.YEAR, year);
		calendar.roll(Calendar.DAY_OF_YEAR, -1);
		Date currYearLast = calendar.getTime();

		return currYearLast;
	}

	public static String addDate(String day, int hourNum) {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");

		Date date = null;
		try {
			date = format.parse(day);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		if (date == null)
			return "";

		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.HOUR_OF_DAY, hourNum);// 为给定的开赛时间添加指定的时间量

		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 通过格式化输出日期
		return dateFormat.format(cal.getTime());
	}

	/**
	 * 获取date的下一天时间
	 * 
	 * @param date
	 * @return
	 */
	public static String getNextDate(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(cal.DATE, 1);
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		return formatter.format(cal.getTime());
	}

	/**
	 * 根据玩法类型获取全场(1)或上半场(2)
	 * 
	 * @param playType
	 *            玩法类型(1 全场让球盘 2 全场单双盘 3 全场大小盘 5 全场标准盘 7 半场让球盘 8 半场标准盘 9 半场大小盘)
	 * @return
	 */
	public static int getGameTime(int playType) {
		return playType < 70 ? 1 : 2;
	}


	/**
	 * 切换盘口类型时,转换成对应盘口类型的赔率
	 * 
	 * @param odd_type
	 *            盘口类型
	 * @param iorH
	 *            主队赔率
	 * @param iorC
	 *            客队赔率
	 * @param showior
	 *            显示位数
	 * @param iorpoints
	 *            赔率小数点位数
	 * @throws Exception
	 */
	public static String[] get_other_ioratio(int odd_type, double iorH, double iorC, String showior, String iorpoints) throws Exception {
		String array[] = new String[2];
		/*// 获得js引擎
		ScriptEngineManager manager = new ScriptEngineManager();
		ScriptEngine engine = manager.getEngineByName("JavaScript");

		// 运行 hg.js
		Reader scriptReader = new InputStreamReader(HgUtil.class.getResourceAsStream("hg.js"));
		try {
			engine.eval(scriptReader);
		} finally {
			scriptReader.close();
		}*/
		initScriptEngine();
		// 调用方法
		if (engine instanceof Invocable) {
			Invocable invEngine = (Invocable) engine;

			// 调用get_other_ioratio方法,获取对应盘口 类型的主客队赔率
			Object object = invEngine.invokeFunction("get_other_ioratio", chg_odd_type(odd_type), iorH, iorC, showior, iorpoints);

			// sun.org.mozilla.javascript.internal.NativeArray，不能直接转为Java的Array
			NativeArray nArray = (NativeArray) object;

			for (int i = 0; i < nArray.getLength(); i++) {
				array[i] = String.valueOf(nArray.get(i, nArray));
			}
		}
		return array;
	}

	/**
	 * 切换盘口
	 * 
	 * @param marketID
	 *            投注盘类型 0香港盘 1印尼盘2马来盘3欧洲盘
	 */
	public static String chg_odd_type(int marketID) {
		String odd_f_type = "H";// 没选择盘口类型时,预设为H(香港盘)

		switch (marketID) {
		case 0:
			odd_f_type = "H";
			break;
		case 1:
			odd_f_type = "I";
			break;
		case 2:
			odd_f_type = "M";
			break;
		case 3:
			odd_f_type = "E";
			break;
		default:
			break;
		}
		return odd_f_type;
	}
	
	/**
	 * 只满足让球
	 * @param tradingItem
	 * @return
	 */
	public static String dealPlayHandicap(String tradingItem) {
		if(null == tradingItem || "".equals(tradingItem)) return tradingItem;
		if(tradingItem.length()>1){
			tradingItem = tradingItem.substring(1, tradingItem.length());
		}
		return tradingItem;
	}

	public static String dealTradingItem(String tradingItem) {
		if(null == tradingItem || "".equals(tradingItem)) return tradingItem;
		String signStr = ".";
		if (tradingItem.contains("/")) {
			tradingItem = tradingItem.replace("/", "-");
			tradingItem = HttpUtil.replaceAllBlank(tradingItem);
		} else {
			if (!tradingItem.contains(signStr)) {
				tradingItem = tradingItem.concat(".0");
			} else {
				// if (!HttpUtility.isZeroRatio(tradingItem)) {
				int index = tradingItem.substring(tradingItem.indexOf(signStr) + signStr.length()).length();
				if (index < 2) {
					tradingItem = tradingItem.concat("0");
				}
				// }
			}
		}
		return tradingItem;
	}

	public static String getEarlyDateTime() {
		String ret = "";
		try {
			Date dateTime = new Date();
			DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

			Calendar cal = Calendar.getInstance();
			cal.setTime(dateTime);
			cal.add(Calendar.HOUR, 12);
			dateTime = cal.getTime();
			ret = formatter.format(dateTime);
		} catch (Exception e) {
			return "";
		}
		return ret;
	}
	
	
	
	public static String getSnatchUrl(HgParamVO hgParamVO){
		String qtstr = "";
		StringBuffer strb = new StringBuffer();
		strb.append(hgParamVO.getUrl());
		String urlphp = "";
		
		if(SnatchConstant.FOOTBALL.equals(hgParamVO.getGameCode())){
			
		/*--------------------------------足球--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/FT_header.php?";
				}
				qtstr = "&game_type=FT";
			}else if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=re&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=r&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/body_browse.php?";
					}
					qtstr = "&rtype=r&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FTCS.equals(hgParamVO.getSnatchItem())){
				//波胆的采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=rpd&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=pd&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/body_browse.php?";
					}
					qtstr = "&rtype=pd&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_HF_FTCS.equals(hgParamVO.getSnatchItem())){
				//半场波胆的采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=hpd&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=hpd&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/index.php?";
					}
					qtstr = "&rtype=hpd&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_TG.equals(hgParamVO.getSnatchItem())){
				//总入球的采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=rt&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=t&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/body_browse.php?";
					}
					qtstr = "&rtype=t&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_HT_FT.equals(hgParamVO.getSnatchItem())){
				//半全场的采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=rf&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_browse/body_browse.php?";
					}
					qtstr = "&rtype=f&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/body_browse.php?";
					}
					qtstr = "&rtype=f&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_browse/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/index.php?";
					}
					qtstr = "&rtype=p3&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/FT_future/body_var.php?";
					}else{
						urlphp = "/app/member/FT_future/index.php?";
					}
					qtstr = "&rtype=p3&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/FT_header.php?";
				}
				qtstr = "&FStype=FT&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=&pages=1&records=40&FStype=FT&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/FT_header.php?";
				}
				qtstr = "&game_type=FT";
			}
			
			
		}else if(SnatchConstant.BASKETBALL.equals(hgParamVO.getGameCode())){
			/*--------------------------------篮球--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BK_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BK_browse/body_browse.php?";
					}
					qtstr = "&rtype=re_all&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BK_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BK_browse/index.php?";
					}
					qtstr = "&rtype=r_all&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BK_future/body_var.php?";
					}else{
						urlphp = "/app/member/BK_future/index.php?";
					}
					qtstr = "&rtype=r_all&mtype=3&league_id=&hot_game=&g_date=ALL";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BK_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BK_browse/index.php?";
					}
					qtstr = "&rtype=p3&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/BK_future/body_var.php?";
					}else{
						urlphp = "/app/member/BK_future/index.php?";
					}
					qtstr = "&rtype=p3&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/BK_header.php?";
				}
				qtstr = "&FStype=BK&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=ALL&pages=1&records=40&FStype=BK&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/BK_header.php?";
				}
				qtstr = "&game_type=BK";
			}
			
		}else if(SnatchConstant.TENNIS.equals(hgParamVO.getGameCode())){
			/*--------------------------------网球--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/TN_browse/body_var.php?";
					}else{
						urlphp = "/app/member/TN_browse/index.php?";
					}
					qtstr = "&rtype=re_all&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/TN_browse/body_var.php?";
					}else{
						urlphp = "app/member/TN_browse/index.php?";
					}
					qtstr = "&rtype=r_all&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/TN_future/body_var.php?";
					}else{
						urlphp = "/app/member/TN_future/index.php?";
					}
					qtstr = "&rtype=r_all&mtype=3&league_id=&hot_game=&g_date=ALL";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/TN_browse/body_var.php?";
					}else{
						urlphp = "/app/member/TN_browse/index.php?";
					}
					qtstr = "&rtype=pr&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/TN_future/body_var.php?";
					}else{
						urlphp = "/app/member/TN_future/index.php?";
					}
					qtstr = "&rtype=pr&mtype=3&league_id=&hot_game=&g_date=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/TN_header.php?";
				}
				qtstr = "&FStype=TN&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=ALL&pages=1&records=40&FStype=TN&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/BK_header.php?";
				}
				qtstr = "&game_type=BK";
			}
			
		}else if(SnatchConstant.VOLLEYBALL.equals(hgParamVO.getGameCode())){
			/*--------------------------------排球--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/VB_browse/body_var.php?";
					}else{
						urlphp = "/app/member/VB_browse/body_browse.php?";
					}
					qtstr = "&rtype=re&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/VB_browse/body_var.php?";
					}else{
						urlphp = "/app/member/VB_browse/index.php?";
					}
					qtstr = "&rtype=r&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/VB_future/body_var.php?";
					}else{
						urlphp = "/app/member/VB_future/index.php?";
					}
					qtstr = "&rtype=r&g_date=&mtype=3&league_id=&hot_game=";
					
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FTCS.equals(hgParamVO.getSnatchItem())){
				//盘口投注
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/VB_browse/body_var.php?";
					}else{
						urlphp = "/app/member/VB_browse/index.php?";
					}
					qtstr = "&rtype=pd&mtype=3&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/VB_future/body_var.php?";
					}else{
						urlphp = "/app/member/VB_future/index.php?";
					}
					qtstr = "&rtype=pd&mtype=3&league_id=&hot_game=&g_date=ALL";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/VB_browse/body_var.php?";
					}else{
						urlphp = "/app/member/VB_browse/index.php?";
					}
					qtstr = "&rtype=pr&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/VB_future/body_var.php?";
					}else{
						urlphp = "/app/member/VB_future/index.php?";
					}
					qtstr = "&rtype=pr&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/VB_header.php?";
				}
				qtstr = "&FStype=VB&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=&pages=1&records=40&FStype=VB&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result_vb.php?";
				}else{
					urlphp = "/app/member/VB_header.php?";
				}
				qtstr = "&game_type=VB";
			}
			
		}else if(SnatchConstant.BASEBALL.equals(hgParamVO.getGameCode())){
			/*--------------------------------棒球--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BS_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BS_browse/index.php?";
					}
					qtstr = "&rtype=re&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BS_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BS_browse/index.php?";
					}
					qtstr = "&rtype=r&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BS_future/body_var.php?";
					}else{
						urlphp = "/app/member/BS_future/index.php?";
					}
					qtstr = "&rtype=r&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/BS_browse/body_var.php?";
					}else{
						urlphp = "/app/member/BS_browse/index.php?";
					}
					qtstr = "&rtype=pr&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/BS_future/body_var.php?";
					}else{
						urlphp = "/app/member/BS_future/index.php?";
					}
					qtstr = "&rtype=pr&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/BS_header.php?";
				}
				qtstr = "&FStype=BS&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=&pages=1&records=40&FStype=BS&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/BS_header.php?";
				}
				qtstr = "&game_type=BS";
			}
			
		}else if(SnatchConstant.OTHER.equals(hgParamVO.getGameCode())){
			/*--------------------------------其它--------------------------------*/
			
			if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(hgParamVO.getSnatchItem())){
				//标准采集
				if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/OP_browse/body_var.php?";
					}else{
						urlphp = "/app/member/OP_browse/index.php?";
					}
					qtstr = "&rtype=re&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/OP_browse/body_var.php?";
					}else{
						urlphp = "/app/member/OP_browse/body_browse.php?";
					}
					qtstr = "&rtype=r&mtype=3&page_no=0&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/OP_future/body_var.php?";
					}else{
						urlphp = "/app/member/OP_future/index.php?";
					}
					qtstr = "&rtype=r&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_PASS.equals(hgParamVO.getSnatchItem())){
				//过关采集
				if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){
						urlphp = "/app/member/OP_browse/body_var.php?";
					}else{
						urlphp = "/app/member/OP_browse/index.php?";
					}
					qtstr = "&rtype=p3&mtype=3&delay=&league_id=&hot_game=";
				}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
					if(hgParamVO.getUrltype()==0){ //
						urlphp = "/app/member/OP_future/body_var.php?";
					}else{
						urlphp = "/app/member/OP_future/index.php?";
					}
					qtstr = "&rtype=p3&g_date=&mtype=3&league_id=&hot_game=";
				}
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST_LOAD.equals(hgParamVO.getSnatchItem())){
				//冠军加载项
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}else{
					urlphp = "/app/member/OP_header.php?";
				}
				qtstr = "&FStype=OP&mtype=3";
			}else if(SnatchConstant.HG_SNATCH_ITEM_FIRST.equals(hgParamVO.getSnatchItem())){
				//冠军
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/browse_FS/reloadgame_R.php?";
				}else{
					urlphp = "/app/member/browse_FS/loadgame_R.php?";
				}
				qtstr = "&choice=ALL&LegGame=&pages=1&records=40&FStype=OP&area_id=&league_id=&rtype=fs&hot_game=";
			}else if(SnatchConstant.HG_SNATCH_ITEM_RESULT.equals(hgParamVO.getSnatchItem())){
				//赛果
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/result/result.php?";
				}else{
					urlphp = "/app/member/OP_header.php?";
				}
				qtstr = "&game_type=OP";
			}
			
		}
		
		
		
		
		
		
		
		
		
		
		
		strb.append(urlphp);
		strb.append("uid=");
		strb.append(hgParamVO.getUid());
		strb.append("&langx=");
		strb.append(hgParamVO.getLangx());
		if(hgParamVO.getPage_no()!=0){
			strb.append("&page_no=");
			strb.append(hgParamVO.getPage_no());
		}if(null != hgParamVO.getMid()){
			strb.append("&mid=");
			strb.append(hgParamVO.getMid());
		}
		strb.append(qtstr);
		
		return strb.toString();
	}
	
	
	
	
	
	/**
	 * 根据盘口类型转换欧赔(该方法只针对单双玩法)
	 * 
	 * @param marketID
	 *            投注盘类型 0香港盘 1印尼盘2马来盘3欧洲盘
	 * @param odds
	 *            需要转换的欧赔
	 * @param scale
	 *            赔率小数点位数
	 * @return
	 */
	public static double tranOddsByOddsType(int marketID, double odds, int scale) {
		double ret = odds;

		switch (marketID) {
		case 0:// 香港盘
			ret = odds - 1;
			break;
		case 1:// 印尼盘
			break;
		case 2:// 马来盘
			break;
		case 3:// 欧洲盘
			break;
		default:// 香港盘
			ret = odds - 1;
			break;
		}
		ret = round(ret, scale);
		return ret;
	}
	
	
	/**
	 * 提供精确的小数位四舍五入处理。
	 * 
	 * @param v
	 *            需要四舍五入的数字
	 * @param scale
	 *            小数点后保留几位
	 * @return 四舍五入后的结果
	 */
	public static double round(double v, int scale) {
		if (scale < 0) {
			throw new IllegalArgumentException(
					"The scale must be a positive integer or zero");
		}

		BigDecimal b = new BigDecimal(Double.toString(v));
		BigDecimal one = new BigDecimal("1");
		return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
	}
	
	
	/**
	 * 根据玩法类型获取玩法名称
	 * 
	 * @param playType
	 *            玩法类型(1 全场让球盘 2 全场单双盘 3 全场大小盘 5 全场标准盘 7 半场让球盘 8 半场标准盘 9 半场大小盘)
	 * 
	 * @return
	 */
	public static String getPlayName(int playType) {
		String playName = "";

		switch (playType) {
		case HgConstant.PLAY_TYPE_ALL_ALLOW: // 全场让球盘
		case HgConstant.PLAY_TYPE_HALF_ALLOW: // 上半场让球盘
			playName = SnatchConstant.ALLOW;
			break;
		case HgConstant.PLAY_TYPE_ALL_ONETWO: // 全场单双盘
			playName = SnatchConstant.ONETWO;
			break;
		case HgConstant.PLAY_TYPE_ALL_BIGSMALL: // 全场大小球
		case HgConstant.PLAY_TYPE_HALF_BIGSMALL: // 上半场大小球
			playName = SnatchConstant.BIGSMALL;
			break;
		case HgConstant.PLAY_TYPE_ALL_STANDARD: // 全场标准盘
		case HgConstant.PLAY_TYPE_HALF_STANDARD: // 上半场标准盘
		case HgConstant.PLAY_TYPE_BASKET_ALL_STANDARD:
			playName = SnatchConstant.STANDARD;
			break;
		case HgConstant. PLAY_TYPE_BASKET_ALL_BIGSMALL_HOST: // 主队大小球
			playName = SnatchConstant.HOSTBIGSMALL;
			break;
		case HgConstant. PLAY_TYPE_BASKET_ALL_BIGSMALL_AWAY: // 客队大小球
			playName = SnatchConstant.AWAYBIGSMALL;
			break;
		default:
			playName = "unknow";
			break;
		}
		return playName;
	}
	
	
	public static String getMtype(){
		return "3";
	}
	
	
	/*public Integer[] findStartTime(String itemName,String itemType){
		 if(SnatchConstant.HG_SNATCH_ITEM_STANDARD.equals(itemName)){
			//标准采集
			if(SnatchConstant.SNATCH_TYPE_GQ.equals(itemType)){
				return HgConstant.ARRAY_MATCH_START_TIME_STANDARD_GQ;
			}else{
				return HgConstant.ARRAY_MATCH_START_TIME_STANDARD_SP;
			}
		}else if(SnatchConstant.HG_SNATCH_ITEM_FTCS.equals(itemName)){
			//波胆的采集
			if(SnatchConstant.SNATCH_TYPE_GQ.equals(itemType)){
				return HgConstant.ARRAY_MATCH_START_TIME_FTCS_GQ;
			}else{
				return HgConstant.ARRAY_MATCH_START_TIME_FTCS_SP;
			}
		}else if(SnatchConstant.HG_SNATCH_ITEM_TG.equals(itemName)){
			//总入球的采集
			if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_browse/body_var.php?";
				}else{
					urlphp = "/app/member/FT_browse/body_browse.php?";
				}
				qtstr = "&rtype=rt&mtype=3&delay=&league_id=&hot_game=";
			}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_browse/body_var.php?";
				}else{
					urlphp = "/app/member/FT_browse/body_browse.php?";
				}
				qtstr = "&rtype=t&mtype=3&delay=&league_id=&hot_game=";
			}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_future/body_var.php?";
				}else{
					urlphp = "/app/member/FT_future/body_browse.php?";
				}
				qtstr = "&rtype=t&g_date=&mtype=3&league_id=&hot_game=";
			}
		}else if(SnatchConstant.HG_SNATCH_ITEM_HT_FT.equals(hgParamVO.getSnatchItem())){
			//半全场的采集
			if(SnatchConstant.SNATCH_TYPE_GQ.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_browse/body_var.php?";
				}else{
					urlphp = "/app/member/FT_browse/body_browse.php?";
				}
				qtstr = "&rtype=rf&mtype=3&delay=&league_id=&hot_game=";
			}else if(SnatchConstant.SNATCH_TYPE_DS.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_browse/body_var.php?";
				}else{
					urlphp = "/app/member/FT_browse/body_browse.php?";
				}
				qtstr = "&rtype=f&mtype=3&delay=&league_id=&hot_game=";
			}else if(SnatchConstant.SNATCH_TYPE_ZC.equals(hgParamVO.getSnatchType())){
				if(hgParamVO.getUrltype()==0){
					urlphp = "/app/member/FT_future/body_var.php?";
				}else{
					urlphp = "/app/member/FT_future/body_browse.php?";
				}
				qtstr = "&rtype=f&g_date=&mtype=3&league_id=&hot_game=";
			}
		}
	}*/
	
}
